package com.duomn.mybatis.action;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/index")
public class IndexAction {
	
	
	@RequestMapping("")
	public String index() {
		return "index";
	}
	
	@ResponseBody
	@RequestMapping("/ajaxReq")
	public String ajaxReq() {
		return "Hello Ajax Request";
	}
	
	@RequestMapping("/reqErr")
	public String reqErr() {
		throw new RuntimeException("ERROR");
	}
	
	@ResponseBody
	@RequestMapping("/ajaxErr")
	public String ajaxErr() {
		throw new IllegalArgumentException("ajax ERROR");
	}

}
